package a.h;

import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import java.awt.*;

public class md
  extends AbstractCellEditor
  implements TableCellEditor, id.b_
{
  private lc a;
  private Object b;
  private JTable c;
  private int d;
  private int e;
  private ob f;
  private boolean g = false;
  private Runnable h;
  private boolean i = false;
  public static int j;
  
  public md(lc paramlc, ob paramob)
  {
    this.a = paramlc;
    this.f = paramob;
    this.h = new Runnable()
    {
      public void run()
      {
        md.this.b();
      }
    };
  }
  
  public Object getCellEditorValue()
  {
    return this.b;
  }
  
  public Component getTableCellEditorComponent(JTable paramJTable, Object paramObject, boolean paramBoolean, int paramInt1, int paramInt2)
  {
    this.c = paramJTable;
    this.d = paramInt1;
    this.e = paramInt2;
    TableCellRenderer localTableCellRenderer = (TableCellRenderer)this.a.c(cd.d);
    Component localComponent = null;
    this.b = paramObject;
    if ((ec.t != 0) || (localTableCellRenderer != null)) {
      localComponent = localTableCellRenderer.getTableCellRendererComponent(paramJTable, paramObject, paramBoolean, false, paramInt1, paramInt2);
    } else {
      localComponent = new DefaultTableCellRenderer().getTableCellRendererComponent(paramJTable, paramObject, paramBoolean, false, paramInt1, paramInt2);
    }
    SwingUtilities.invokeLater(this.h);
    return localComponent;
  }
  
  void b()
  {
    int m = ec.t;
    this.i = this.a.m();
    int k = this.a.b().a().size();
    this.g = true;
    id localid = new id(this.a, this.c, this.c.getCellRect(this.d, this.e, true), this.f);
    localid.a(this);
    if (m == 0) {
      if (k > 0)
      {
        JPopupMenu localJPopupMenu = localid.a();
        Rectangle localRectangle = this.c.getCellRect(this.d, this.e, true);
        localJPopupMenu.show(this.c, localRectangle.x, localRectangle.y);
      }
    }
    if ((m != 0) || ((ec.s) && (((Boolean)this.a.c("IconOptionItem.ALLOW_BROWSE")).booleanValue()))) {
      localid.a(null);
    }
  }
  
  private void c()
  {
    if ((ec.t != 0) || (this.c != null)) {
      this.c.requestFocus();
    }
  }
  
  public void a(JPopupMenu paramJPopupMenu, Object paramObject)
  {
    this.b = paramObject;
    this.g = false;
    if (ec.t == 0)
    {
      if (paramJPopupMenu != null) {
        paramJPopupMenu.setVisible(false);
      }
      stopCellEditing();
      this.c.setValueAt(paramObject, this.d, this.e);
      c();
    }
  }
  
  public void a()
  {
    this.g = false;
    cancelCellEditing();
    c();
  }
  
  public boolean stopCellEditing()
  {
    if (ec.t == 0) {
      if (!this.g) {
        return super.stopCellEditing();
      }
    }
    return false;
  }
  
  public void cancelCellEditing()
  {
    this.g = false;
    super.cancelCellEditing();
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.h.md

 * JD-Core Version:    0.7.0.1

 */